import React, { Component } from "react"
import { Provider } from "react-redux"
import { withStore as configStore } from "@/store/index"
import { patch } from "@/utils/patch"
import { getWindowInfo, htmlTransform } from "@/utils/core"

import "gp-editorjs/dist/style.css"
import "@taroify/icons/index.scss"
import "@taroify/core/index.scss"
import "windi.css"
import "./app.scss"

if (process.env.TARO_ENV !== "h5") {
  require("@tarojs/taro/html.css")
}
if (process.env.TARO_ENV === "swan") {
  require("@/styles/platform/swan/component.scss")
}
patch()
if (process.env.TARO_ENV === "weapp") {
  htmlTransform()
}
const store = configStore()
class App extends Component {
  componentDidMount() {}
  onLaunch() {
    getWindowInfo()
  }
  componentDidShow() {}

  componentDidHide() {}

  componentDidCatchError() {}

  // this.props.children 是将要会渲染的页面
  render() {
    return <Provider store={store}>{this.props.children}</Provider>
  }
}

export default App
